package com.tk.ehr.controller;

import com.github.pagehelper.PageInfo;
import com.tk.ehr.model.entity.SysMenu;
import com.tk.ehr.service.SysMenuService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sysMenu")
public class SysMenuController {

  @Resource
  private SysMenuService sysMenuService;

  @GetMapping("/selectByPrimaryKey")
  public SysMenu selectByPrimaryKey(Long userId) {
    return sysMenuService.selectByPrimaryKey(userId);
  }

  @GetMapping("/list")
  public List<SysMenu> list() {
    return sysMenuService.list();
  }

  @GetMapping("/page")
  public PageInfo<SysMenu> page(Integer pageNum, Integer pageSize) {
    return sysMenuService.page(pageNum, pageSize);
  }
}
